package com.zelin.service.impl;

import com.zelin.mapper.StudentMapper;
import com.zelin.pojo.Student;
import com.zelin.service.StudentService;
import com.zelin.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/11/1-10:32
 * ------------------------------
 */
public class StudentServiceImpl implements StudentService {
    //1. 得到sqlSession
    private SqlSession sqlSession = MyBatisUtil.getSqlSession(true);
    //2. 得到Mapper对象
    private StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);
    //3. 查询所学生
    public List<Student> findAll(){
        return studentMapper.findAll();
    }
}
